
function onClick_li(obj)
{
	$(obj).parent().children('li').each(function(){
		$(this).children("span").css('padding','0px');
		$(this).children("span").css('background-color',"white");
	});
	$(obj).children("span").css('padding','5px');
	$(obj).children("span").css('background-color','#efefef');
	$('#group_id_hidden').attr('value',$(obj).children("span").attr('title'));
	$('#group_id_hidden_2').attr('value',$(obj).children("span").attr('title'));
	return true;
}

function moveOptionUp(str)
{
	var theSel=document.getElementById(str);
	var index=theSel.selectedIndex;
	if(index > 0)
	{
		swapOptions(theSel,index-1,index);
		theSel.selectedIndex=index-1;
	}
}

function moveOptionDown(str)
{
	var theSel=document.getElementById(str);
	var index=theSel.selectedIndex;
	if(index < theSel.length-1)
	{
		swapOptions(theSel,index,index+1);
		theSel.selectedIndex=index+1;
	}
}

function swapOptions(theSel,index1,index2)
{
	var text,value;
	text=theSel.options[index1].text;
	value=theSel.options[index1].value;
	theSel.options[index1].text = theSel.options[index2].text;
	theSel.options[index1].value = theSel.options[index2].value;
	theSel.options[index2].text=text;
	theSel.options[index2].value=value;
}

function storeRate(str)
{
	var theSel=document.getElementById(str);
	l=theSel.options.length;
	_str="?rate="
	for(var i=0;i<l;i++)
	{
		_str+=theSel.options[i].value;
		if(i != l-1)
		{
			_str+="_"
		}
	}
	var protocol="http://"
	var host=window.location.host;
	var pathname=window.location.pathname;
	window.location.href=protocol+host+pathname+_str;
}

function overIt(a){
	$(a).children("td").each(function(){
		$(this).css('background-color','#e6e6e6');
	})
}
function outIt(a){
	$(a).children("td").each(function(){
		$(this).css('background-color','#fff');
	})
}

function getUrlArgs(){
	var args = {};
	var query = location.search.substring(1);
	if( ! query ) return args;
	var pairs = query.split("&");
	for(var i = 0; i < pairs.length; i++ ) {
		var pos = pairs[i].indexOf('=');
		if (pos === -1) continue;
		var argname = pairs[i].substring(0, pos);
		var value = pairs[i].substring(pos + 1);
		value = decodeURIComponent(value);
		args[argname] = value;
	}
	return args;
}
